<% form_remote_for [@edition.release, @edition, @disc] do |disc_form| %>

  <div id="form-errors">
    <%= disc_form.error_messages %>
  </div>

  <p>
    <%= disc_form.label :number %><%= disc_form.text_field :number %><br />
    <%= disc_form.label :title %><%= disc_form.text_field :title %><br />
    <%= disc_form.label :format %><%= disc_form.select :format, Disc::DISC_FORMATS %>
  </p>

<table>
  <tr>
    <th>Track</th>
	<th>Name</th>
	<th>Length</th>
  </tr>

    <% disc_form.fields_for :songs do |song_form| %>
      <%= render "song_fields", :f => song_form %>
	<% end %>
	
	<tr><td>
	<p><%= link_to_add_fields "Add Track", disc_form, :songs %></p>
	</td></tr>
</table>

  <%= disc_form.submit "Add Disc" %>
  <%= button_to_remote "Cancel", :url => release_edition_discs_path, :edition_id => @edition.id, :method => :post %>

<% end %>